home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DBASE_UT / VMODE / VMODE.PAS < prev   
Pascal/Delphi Source File  |  1995-01-22  |  4KB  |  210 lines

  1. Unit Vmode;
  2. {$Define Test}
  3. {    Remove this line to remove debug code (see compiler directives). }
  4.  
  5. {    Version 1.0.0.T.
  6.     Created Monday, January 23, 1995.
  7.  
  8.     Requires Borland Turbo Pascal version 6.0 or later to compile.
  9.  
  10.     Author:  Bruce J. Lackore of Kestrel Technologies.  
  11.     Copyright (c) 1995 Bruce J. Lackore.  ALL RIGHTS RESERVED.
  12. }
  13.  
  14. {$IFDEF Test}
  15.     {$A+,B-,D+,F+,G-,I+,L+,O+,R+,S+,V-,X+}
  16. {$ELSE}
  17.     {$A+,B-,D-,F+,G-,I-,L-,O+,R-,S-,V-,X+}
  18. {$ENDIF}
  19.  
  20. {    This simple unit contains the code necessary to change video modes on VGA
  21.     and EGA monitors.  The routines are Real Simple and require no parameters
  22.     of any kind.  Writing programs to surround them to change modes at the
  23.     DOS prompt is trivial (see examples).
  24.  
  25.     One caveat:  I have NOT tested these routines on an EGA system - I don't
  26.                              have one.  Let me know if they don't work for some reason.
  27. }
  28.  
  29. Interface
  30.  
  31. Type
  32.     Video_font_modes                    = (CGA_25, EGA_25, EGA_43,
  33.                                                                 VGA_25, VGA_43, VGA_50);
  34.  
  35. Var
  36.     Video_font_mode:                    Video_font_modes;
  37.  
  38. Procedure VGA25;
  39.  
  40. {    This procedure sets the video display to standard 25-line mode.  This
  41.     procedure can be selected without prior knowledge of the current video
  42.     settings, the procedure automatically presumes worst case.
  43. }
  44.  
  45. Procedure VGA43;
  46.  
  47. {    This procedure sets the video display to the little-known 43 line mode of
  48.     the VGA card.  (normally the 8x8 font gives 50 lines).  It does so by
  49.     selecting the standard 8x8 font BUT it switches the scan line count from
  50.     the normal 480 to 350, making the characters slightly larger, giving the
  51.     43 lines of text.
  52. }
  53.  
  54. Procedure VGA50;
  55.  
  56. {    This procedure sets the video display to standard 50-line mode.  This
  57.     procedure can be selected without prior knowledge of the current video
  58.     settings, the procedure automatically presumes worst case.
  59. }
  60.  
  61. Procedure EGA25;
  62.  
  63. {    This procedure sets the video display to 25-line mode.
  64. }
  65.  
  66. Procedure EGA43;
  67.  
  68. {    This procedure sets the video display to 43-line mode.
  69. }
  70.  
  71. { ************************************************************************** }
  72.  
  73. Implementation
  74.  
  75. Uses Dos;
  76.  
  77. Procedure VGA25;
  78.  
  79.     Var
  80.         Regs:                                        Registers;
  81.  
  82.     Begin  { Procedure VGA25 }
  83.  
  84.         {    Reset video mode }
  85.  
  86.         Regs.Ax := $0003;
  87.         Intr($10, Regs);
  88.  
  89.         {    Select 480 scan lines - standard }
  90.  
  91.         Regs.Ax := $1202;
  92.         Regs.Bl := $30;
  93.         Intr($10, Regs);
  94.  
  95.         {    Reset the video mode again (just in case) }
  96.  
  97.         Regs.Ax := $0003;
  98.         Intr($10, Regs);
  99.  
  100.         {    Select standard 8x14 font }
  101.  
  102.         Regs.Ax := $1114;
  103.         Regs.Bl := $00;
  104.         Intr($10, Regs);
  105.         Video_font_mode := VGA_25
  106.     End;  { Procedure VGA25 }
  107.  
  108. Procedure VGA43;
  109.  
  110.     Var
  111.         Regs:                                        Registers;
  112.  
  113.     Begin  {  Procedure VGA43 }
  114.  
  115.         {    Reset video mode }
  116.  
  117.         Regs.Ax := $0003;
  118.         Intr($10, Regs);
  119.  
  120.         {    Select 350 scan lines - this gives 43 lines when using the 8x8 font }
  121.  
  122.         Regs.Ax := $1201;
  123.         Regs.Bl := $30;
  124.         Intr($10, Regs);
  125.  
  126.         {    Reset the video mode again (just in case) }
  127.  
  128.         Regs.Ax := $0003;
  129.         Intr($10, Regs);
  130.  
  131.         {    Select standard 8x8 font }
  132.  
  133.         Regs.Ax := $1112;
  134.         Regs.Bl := $00;
  135.         Intr($10, Regs);
  136.         Video_font_mode := VGA_43
  137. End;  { Procedure VGA43 }
  138.  
  139. Procedure VGA50;
  140.  
  141.     Var
  142.         Regs:                                        Registers;
  143.  
  144.     Begin  { Procedure VGA50 }
  145.  
  146.         {    Reset video mode }
  147.  
  148.         Regs.Ax := $0003;
  149.         Intr($10, Regs);
  150.  
  151.         {    Select 480 scan lines - standard }
  152.  
  153.         Regs.Ax := $1202;
  154.         Regs.Bl := $30;
  155.         Intr($10, Regs);
  156.  
  157.         {    Reset the video mode again (just in case) }
  158.  
  159.         Regs.Ax := $0003;
  160.         Intr($10, Regs);
  161.  
  162.         {    Select standard 8x8 font }
  163.  
  164.         Regs.Ax := $1112;
  165.         Regs.Bl := $00;
  166.         Intr($10, Regs);
  167.         Video_font_mode := VGA_25
  168.     End;  { Procedure VGA50 }
  169.  
  170. Procedure EGA25;
  171.  
  172.     Var
  173.         Regs:                                        Registers;
  174.  
  175.     Begin  { Procedure EGA25 }
  176.  
  177.         {    Reset the video mode (just in case) }
  178.  
  179.         Regs.Ax := $0003;
  180.         Intr($10, Regs);
  181.  
  182.         {    Select standard 8x14 font }
  183.  
  184.         Regs.Ax := $1114;
  185.         Regs.Bl := $00;
  186.         Intr($10, Regs);
  187.         Video_font_mode := EGA_25
  188.     End;  { Procedure EGA25 }
  189.  
  190. Procedure EGA43;
  191.  
  192.     Var
  193.         Regs:                                        Registers;
  194.  
  195.     Begin  { Procedure EGA43 }
  196.  
  197.         {    Reset the video mode (just in case) }
  198.  
  199.         Regs.Ax := $0003;
  200.         Intr($10, Regs);
  201.  
  202.         {    Select standard 8x8 font }
  203.  
  204.         Regs.Ax := $1112;
  205.         Regs.Bl := $00;
  206.         Intr($10, Regs);
  207.         Video_font_mode := VGA_43
  208.     End;  { Procedure EGA43 }
  209.  
  210. End.  { Unit Vmode }